<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vue示例</title>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/3.2.40/vue.global.js"></script>
</head>
<body>
<div id="app">
    <p>原始的字符串{{msg}}</p>
    <p>利用插值表达式{{msg.split('').reverse().join('')}}</p>
    <p>使用方法{{reverseMsg()}}</p>
    <p>使用计算属性{{reverseMsgCom}}</p>
    <p>{{height}}</p>
</div>
<script>
    var count = 1;
const app = Vue.createApp({
data() {
return{
    msg:'guilin!!!!',
    height:157
   
}
},
methods: {
    reverseMsg(){
        console.log('methods');
        count++;
        return count+this.msg.split('').reverse().join('')
    }
},
computed: {
    reverseMsgCom(){
        console.log('computed');
        count++;
        return this.height+this.msg.split('').reverse().join('')
    }
},
watch: {
}
})
const vm=app.mount("#app");
// vm.reverseMsgCom=123
</script>
</body>
</html>